﻿using System;
using System.Collections.Generic;
using System.Linq;

using HelfenHelfen.DataAccess.Entities;
using HelfenHelfen.DataAccess.Interfaces;

namespace HelfenHelfen.DataAccess {
   public class ImageDataAccess : IImageDataAccess {

      public void Insert(Image newImage) {
         throw new NotImplementedException();
      }

      public void Update(Image updateImage) {
         throw new NotImplementedException();
      }

      public void Delete(Guid ImageId) {
         throw new NotImplementedException();
      }

      public Image GetByDemand(Guid demandId) {
         using (HelfenHelfenEntities db = new HelfenHelfenEntities()) {
            var obj = (from image in db.Images
                       where image.DemandGUID == demandId
                       select image).FirstOrDefault();
            return obj;
         }
      }         
   }
}
